<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCategoriesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('categories', function (Blueprint $table) {
            $table->id();
            $table->string('name',20)->comment('名称');
            $table->integer('parent_id')->default(0)->comment('上级ID');
            $table->tinyInteger('type')->default(0)->comment('类型0:频道封面1:列表栏目2外部链接');
            $table->string('seo_title',255)->default('')->comment('SEO标题');
            $table->string('keywords',255)->default('')->comment('关键词');
            $table->string('description',255)->default('')->comment('描述');
            $table->string('image',100)->default('')->comment('图片');
            $table->string('href',100)->default('')->comment('链接');
            $table->string('channel_tpl',100)->default('')->comment('栏目页模板');
            $table->string('list_tpl',100)->default('')->comment('列表页模板');
            $table->string('show_tpl',100)->default('')->comment('详情页模板');
            $table->integer('sort')->default(0)->comment('排序');
            $table->tinyInteger('status')->default(0)->comment('状态1:显示;0:隐藏');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('categoies');
    }
}
